package com.danawa.mds.market.model;

import java.util.List;

import org.springframework.orm.hibernate3.support.HibernateDaoSupport;

public class HibernateBuyerRepository extends HibernateDaoSupport implements
		BuyerRepository {

	public void save(Buyer buyer) {
		getHibernateTemplate().save(buyer);
	}

	@SuppressWarnings("unchecked")
	public Buyer find(Long memberSeq) {
		List<Buyer> result = (List<Buyer>) getHibernateTemplate().find(
				"from Buyer where memberSeq=?", memberSeq);
		if (result != null && result.size() > 0) {
			return result.get(0);
		}
		return null;
	}

}
